<template>
  <div v-if="Object.keys(goods).length !== 0" class="base-info">
    <div class="title">{{ goods.title }}</div>
    <div class="price">
      <span class="price_1">{{ goods.newPrice }}</span>
      <span class="price_2">{{ goods.oldPrice }}</span>
      <span class="discount">{{ goods.discount }}</span>
    </div>
    <div class="other">
      <span>{{ goods.columns[0] }}</span>
      <span>{{ goods.columns[1] }}</span>
      <span>{{ goods.services[goods.services.length - 1].name }}</span>
    </div>
    <div class="service">
      <span v-for="index in goods.services.length - 1" :key="index">
        <img :src="goods.services[index - 1].icon" />
        <span>{{ goods.services[index - 1].name }}</span>
      </span>
    </div>
  </div>
</template>

<script>
export default {
  name: "DetailBaseInfo",
  props: {
    goods: {
      type: Object,
    },
  },
};
</script>

<style scoped>
.base-info{
  margin: 15px 10px 5px 10px;
}
.title{
  font-size: 14px;
}
.price{
  position: relative;
  margin: 10px 0;
}
.price_1{
  font-size: 24px;
  color: #ff5777;
}
.price_2{
  font-size: 13px;
  color: #999;
  margin: 0 5px;
}
.discount{
  position: absolute;
  top: 0;

  font-size: 12px;
  color: #fff;
  background-color: #ff5777;
  border-radius: 8px;
  padding: 2px 5px;
}

.other{
  display: flex;
  justify-content: space-between;
  color: #999;
  margin: 10px 0 5px 0;
  padding-bottom: 8px;
  border-bottom: solid 1px rgb(221, 221, 221);
  font-size: 13px;
}
.service{
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #000;
  margin: 30px 0;
}
.service img{
  width: 14px;
  height: 14px;
  vertical-align:middle;
}
</style>